
#include "lineedit.h"

#include <QLineEdit>
#include <QHBoxLayout>
#include <QMessageBox>
//#include <QKeyEvent>
#include <QToolButton>
#include <QTimer>

//void LEdit::keyPressEvent(QKeyEvent *event)
//{
//	QMessageBox::information(this, "", QString("Kod: %1").arg(event->key()));
//}

void LEdit::focusInEvent(QFocusEvent * event) {
	QLineEdit::focusInEvent(event);
	QTimer::singleShot(0, this, SLOT(selectAll()));
}

//LineEdit::LineEdit(QWidget *parent) :
//	QWidget(parent)
//{
//	le = new LEdit();
////	le = new QLineEdit();
//	eraseTB = new QToolButton();
//	eraseTB->setIcon(QIcon(":/images/close.png"));
////	eraseTB->setMinimumSize(48, 48);

//	connect(le, SIGNAL(textChanged(QString)), this, SIGNAL(textEdited(QString)));
//	connect(le, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()));
//	connect(eraseTB, SIGNAL(clicked()), le, SLOT(clear()));

//	QHBoxLayout *hl = new QHBoxLayout();
//	hl->setContentsMargins(0, 0, 0, 0);
//	hl->addWidget(le);
//	hl->addWidget(eraseTB);

//	setLayout(hl);
//}

